package com.hpeng.sys.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.hpeng.sys.model.AssetCard;
import com.hpeng.sys.model.SysUser;
import com.hpeng.sys.service.AssetCardsMgr;
import com.hpeng.sys.service.DepartmentsMgr;
import com.hpeng.util.Pagination;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

@Component("AssetCardAction")
@Scope("prototype")
public class AssetCardAction extends ActionSupport implements ModelDriven<AssetCard> {
	public Pagination<AssetCard> pagination;
	private AssetCard assetCard;
	private String departmentId;
	private List<AssetCard> assetCards;
	private String assetCardId;
	private List<String> assetCardIds;
	public List<String> getAssetCardIds() {
		return assetCardIds;
	}
	public void setAssetCardIds(List<String> assetCardIds) {
		this.assetCardIds = assetCardIds;
	}
	public AssetCard getModel() {
		// TODO Auto-generated method stub
		return assetCard;
	}
	public String getAssetCardsByDepId(){
		System.out.println("ddddddddddddd"+departmentId);
		setAssetCards(assetCardsMgr.getAssetCardByDepName(departmentId));
		return "SUCCESS";
	}
	public String ToGoAssetCard(){
		assetCardsMgr.ToGo(assetCardIds);
		return "SUCCESS";
	}
	public void setDepartmentId(String departmentId) {
		this.departmentId = departmentId;
	}
	public String getDepartmentId() {
		return departmentId;
	}
	public void setAssetCards(List<AssetCard> assetCards) {
		this.assetCards = assetCards;
	}
	public List<AssetCard> getAssetCards() {
		return assetCards;
	}
	public void setAssetCardId(String assetCardId) {
		this.assetCardId = assetCardId;
	}
	public String getAssetCardId() {
		return assetCardId;
	}
	@Resource
	private AssetCardsMgr assetCardsMgr;
}
